import request from '@/utils/request.js'

// 获取评论回复
export const getCommentAPI = params => {
  return request({
    method: 'GET',
    url: '/v1_0/comments',
    params
  })
}

// 对文章点赞
export const addLikeCommentAPI = target => {
  return request({
    method: 'POST',
    url: '/v1_0/comment/likings',
    data: {
      target
    }
  })
}

// 对文章取消点赞
export const deteleLikeCommentAPI = target => {
  return request({
    method: 'DELETE',
    url: `/v1_0/comment/likings/${target}`
  })
}

// 添加评论或评论回复
export const getArticleCommentlAPI = data => {
  return request({
    method: 'POST',
    url: `/v1_0/comments`,
    data
  })
}
